<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function myfn(){
		d1.innerHTML +="<div></div>";
		d1.innerHTML +="<div></div>";
	}
</script>
<style type="text/css">
	div div{
		width: 30px;
		height: 30px;
		background-color: red;	
		margin: 4px;
	}
</style>
</head>
<body>
<input type="button" value="添加" onclick="myfn()">
<div id="d1"></div>
</body>
</html>